package com.uzai.console.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.uzai.console.dto.cms.tbgoods.CmsMerTbGoodsQuery;
import com.uzai.console.dto.cms.tbgoods.CmsMerTbGoodsQuery;
import com.uzai.console.entity.CmsMerTbGoods;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;

@Repository
public interface CmsMerTbGoodsMapper {
    int deleteById(@Param("id") Long id, @Param("merId") Long merId);
    int insert(CmsMerTbGoods record);

    int insertSelective(CmsMerTbGoods record);

    CmsMerTbGoods selectById(@Param("id") Long id, @Param("merId") Long merId);

    CmsMerTbGoods selectByMerIdAndItemid(@Param("merId") Long merId, @Param("itemid") Long itemid);

    int updateByIdSelective(CmsMerTbGoods record);

    int updateById(CmsMerTbGoods record);

    int deleteByMerId(Long merId);

    /**
     * 分页查询
     * @param page
     * @param query
     * @return
     */
    ArrayList<CmsMerTbGoods> findByList(Page<CmsMerTbGoods> page, @Param("query") CmsMerTbGoodsQuery query);

    /**
     * 查询所有
     * @param query
     * @return
     */
    ArrayList<CmsMerTbGoods> findByList(@Param("query") CmsMerTbGoodsQuery query);
}